﻿<%@ Page Language="C#" MasterPageFile="~/WebSite.Master" AutoEventWireup="true" CodeBehind="CAOrderList.aspx.cs"
    Inherits="RN.ERP.Web.CA.CAOrderList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script type="text/javascript">
        function OpenAlert(text) {
            $.ligerDialog.warn(text);
            return false;
        }
        /*打开添加窗口*/
        function ShowAddForm(url) {
            var str = url.split("=");
            if (str[str.length - 1] == "") {
                var chk = $("input:checked");
                if (chk.length == 0) {
                    OpenAlert("请选择一个订单！");
                    return false;
                }
                if (chk.eq(0).attr("class") == "0" || chk.eq(0).attr("class") == "1") {
                    url += chk.eq(0).val() + "&group=" + $("#hidGroup").val();
                }
                else {
                    OpenAlert("该订单不可再次提交！");
                    return false;
                }
            }
            $.ligerDialog.open({ url: url, width: 900, height: 600, title: '订单信息', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
            return false;
        }
        function ShowForm(url) {
            var guids = ""; //所选订单id的集合
            var str = url.split("=");
            if (str[str.length - 1] == "") {
                var chk = $("input:checked");
                if (chk.length == 0) {
                    OpenAlert("请选择至少一个订单！");
                    return false;
                }
                for (i = 0; i < chk.length; i++) {
                    if (chk.length > 1 && i <= (chk.length - 2) && chk.eq(i).attr("catype") != chk.eq(i + 1).attr("catype")) {
                        OpenAlert("不同类型订单不可一起索要发票！");
                        return false;
                    } else if (chk.eq(i).attr("status") != "") {
                        OpenAlert("所选订单中存在已开发票订单！");
                        return false;
                    }
                    else if (chk.eq(i).attr("class") != "4" && chk.eq(i).attr("class") != "3") {
                        OpenAlert("所选订单中存在非财务确认订单！");
                        return false;
                    }
                    else if (chk.eq(i).attr("status") == "") {
                        if (guids.length > 0) {
                            guids += ',' + chk.eq(i).attr("flag");
                        } else {
                            guids = chk.eq(i).attr("flag");
                        }
                    }

                }
                url += guids;
            }
            $.ligerDialog.open({ url: url, width: 900, height: 600, title: '订单信息', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
            return false;
        }
        function ShowMoneyForm(url) {
            $.ligerDialog.open({ url: url, width: 530, height: 300, title: '银行付款方式', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
            return false;
        }

        function EditOrder() {
            var chk = $("input:checked");
            if (chk.length == 0) {
                OpenAlert("请选择要修改的订单！");
                return false;
            }
            else {
                if (chk.eq(0).attr("class") == "0") {
                    location.href = "../CA/CAOrderDetail.aspx?orderGuid=" + chk.eq(0).val() + "&group=" + $("#hidGroup").val();
                }
                else {
                    OpenAlert("已提交订单不可修改！");
                    return false;
                }
            }
        }
        function RefreshWin() {
            location.href = location.href;
        }
        function CloseWin(data) {
            if (data == "1") {
                RefreshWin();
            }
        }
        $(function () {
            var group = $("#hidGroup").val();
            if (group == "CA01") {
                $(".after1").css("display", "");
                $(".after2").css("display", "none");
                $(".after3").css("display", "none");
                $(".after4").css("display", "none");
            }
            else if (group == "CA02") {
                $(".after1").css("display", "none");
                $(".after2").css("display", "");
                $(".after3").css("display", "none");
                $(".after4").css("display", "none");
            }
            else if (group == "CA03") {
                $(".after1").css("display", "none");
                $(".after2").css("display", "none");
                //$(".after3").css("display", "");
                $(".after4").css("display", "none");
            }
            else if (group == "CA04") {
                $(".after1").css("display", "none");
                $(".after2").css("display", "none");
                $(".after3").css("display", "none");
                //$(".after4").css("display", "");
            }
            else {
                $(".liucheng").css("display", "none");
            }
            $(".a_del").click(function () {
                var chk = $("input:checked");
                if (chk.length == 0) {
                    OpenAlert("请选择要删除的订单！");
                    return false;
                }
                else {
                    $.ligerDialog.confirm("确定删除？", DeleteOrders);
                    //radconfirm('确定删除？', DeleteOrders, 300, 150, null, '提示');
                    return false;
                }
            });
        })
        function ClickCheck() {
            if ($("#hidGroup").val() != "") {
                $('input[type="checkbox"]').click(function () {
                    if ($(this).attr('checked')) {
                        $('input[type="checkbox"]').removeAttr('checked');
                        $(this).attr('checked', 'checked');
                    }
                });
            }
        }
        function DeleteOrders(arg) {
            if (arg) {
                var keyguids = "";
                var chk = $("input:checked");
                for (i = 0; i < chk.length; i++) {
                    if (chk.eq(i).attr("class") == "0") {
                        keyguids += chk.eq(i).val() + ',';
                    }
                    else {
                        OpenAlert("已提交订单不可删除！");
                        return false;
                    }
                }
                $.ajax({
                    async: false,
                    url: "CAOrderList.aspx/DelOrders",
                    data: "{ 'keyguids':'" + keyguids + "'}",
                    type: "post",
                    cache: false,
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        var json = eval('(' + data.d + ')');
                        //radalert(json.Message, 250, 150, '提示', RefreshWin);
                        //OpenAlert(json.Message);
                        //RefreshWin();
                        $.ligerDialog.warn(json.Message, "", RefreshWin);
                    }
                });
            }
        }
    </script>
    <style type="text/css">
        .img_nr
        {
            width: 117px;
            float: left;
        }
        .img_h
        {
            width: 117px;
            height: 33px;
            line-height: 33px;
            font-size: 16px;
            font-weight: bold;
            color: #fff;
            text-align: center;
            background: url(../images/img_h_CA.jpg) left top no-repeat;
        }
        .img_border
        {
            padding: 7px;
            font-size: 14px;
            color: #000;
            border-left: 1px #43a9f5 solid;
            border-right: 1px #43a9f5 solid;
        }
        .img_border a
        {
            color: #0c2ae4;
            text-decoration: underline;
        }
        .arrow
        {
            width: 34px;
            height: 230px;
            background: url(../images/arrow_CA.jpg) left center no-repeat;
            float: left;
        }
        .img_l
        {
            width: 27px;
            height: 230px;
            background: url(../images/img_left_CA.jpg) left center no-repeat;
            float: left;
        }
        .img_r
        {
            width: 24px;
            height: 230px;
            background: url(../images/img_right_CA.jpg) left center no-repeat;
            float: left;
        }
        .arrow_x
        {
            width: 52px;
            height: 230px;
            background: url(../images/arrow_x_CA.jpg) left center no-repeat;
            float: left;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="100%" style="table-layout: fixed; margin-top: 5px;" border="0" cellspacing="0"
        cellpadding="0" align="center">
        <%--<tr>
            <td colspan="4" height="30" class="position">
                您所在的位置：<a href="#">首页</a>&gt;&gt;<span class="blue">订单列表</span>
            </td>
        </tr>--%>
        <tr>
            <td class="xx_m  tt_xx_l">
            </td>
            <td class="xx_m  tt_xx_icon">
            </td>
            <td style="width: auto;" class="xx_m">
                订单列表
            </td>
            <td style="width: 14px;">
                <img src="../images/xx_r.jpg" width="14" height="33" />
            </td>
        </tr>
        <tr>
            <td class="left_con">
                &nbsp;
            </td>
            <td colspan="2" style="padding-left: 6px; padding-right: 6px;" valign="top">
                <!--#订单列表-->
                <div>
                    <div class="xian">
                        <div class="about_title">订单列表</div>
                        <div class="i-con-cn">
                            <span id="invoice" runat="server">
                                <a style="cursor: pointer; color: Black;" class="xtbiao"
                                    onclick="ShowForm('CAOrderInvoice.aspx?o=');">索要发票</a>
                            </span>
                            <span id="submit" runat="server" style="margin-left: 20px;">
                                <a class="xtbiao" onclick="ShowAddForm('CASubmitOrder.aspx?guid=');"
                                    style="cursor: pointer; color: Black;">提交订单</a>
                            </span>
                            <span id="edit" runat="server">
                                <a style="cursor: pointer;" onclick="EditOrder();" class="xtbiao">修改订单</a>
                            </span>
                            <span id="del" runat="server">
                                <a style="cursor: pointer;" class="a_del xtbiao">删除订单</a>
                            </span>
                            <span id="add" runat="server">
                                <a id="addOrder" runat="server" class="xtbiao">添加订单</a>
                            </span>
                        </div>
                    </div>
                    <telerik:RadGrid ID="RadGrid1" runat="server" ShowStatusBar="True" AllowSorting="true"
                        CssClass="tab" AllowFilteringByColumn="false" CellSpacing="0" Culture="zh-CN"
                        GridLines="None" AllowPaging="true" AllowCustomPaging="true" OnNeedDataSource="RadGrid1_NeedDataSource"
                        Width="100%" OnItemDataBound="RadGrid1_ItemDataBound">
                        <MasterTableView AutoGenerateColumns="false" DataKeyNames="ID" NoMasterRecordsText="暂无数据"
                            InsertItemPageIndexAction="ShowItemOnCurrentPage" CommandItemDisplay="Top">
                            <CommandItemSettings ExportToPdfText="Export to PDF" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="true">
                            </RowIndicatorColumn>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                            <PagerStyle AlwaysVisible="True" />
                            <CommandItemTemplate>
                            </CommandItemTemplate>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="选择" UniqueName="Choose" HeaderStyle-Width="5%"
                                    HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <input id="ckbChoose" class='<%#Eval("bCAStatus") %>' flag='<%#Eval("ID") %>' catype='<%#Eval("GroupCode") %>'
                                            status='<%#Eval("InvoiceStatus") %>' type="checkbox" value='<%#Eval("KeyGUID") %>'
                                            runat="server" />
                                        <input id="hidStatus" type="hidden" value='<%#Eval("bCAStatus") %>' />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="订单编号" UniqueName="Code" HeaderStyle-Width="12%"
                                    HeaderStyle-HorizontalAlign="Center" SortExpression="Code">
                                    <ItemTemplate>
                                        <a style="cursor: pointer; color: Black;" onclick='<%# GetInvoiceUrl(Eval("KeyGUID"),Eval("GroupCode")) %>'>
                                            <%#Eval("Code")%></a>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn HeaderText="公司名称" UniqueName="CorpName" HeaderStyle-Width="15%"
                                    HeaderStyle-HorizontalAlign="Center">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="LinkPerson" HeaderText="联系人" UniqueName="LinkPerson"
                                    HeaderStyle-Width="9%" HeaderStyle-HorizontalAlign="Center">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="officeTel" HeaderText="联系电话" UniqueName="officeTel"
                                    HeaderStyle-Width="10%" HeaderStyle-HorizontalAlign="Center">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="SumPay" HeaderText="金额<br/>(单位：元)" UniqueName="SumPay"
                                    HeaderStyle-Width="7%" HeaderStyle-HorizontalAlign="Center">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="RegisterDate" SortExpression="RegisterDate" FilterListOptions="VaryByDataType"
                                    HeaderText="订单生成时间" UniqueName="RegisterDate" HeaderStyle-Width="11%" HeaderStyle-HorizontalAlign="Center">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="GroupName" HeaderText="订单类型" UniqueName="GroupName"
                                    HeaderStyle-Width="9%" HeaderStyle-HorizontalAlign="Center">
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn DataField="StrStatus" FilterListOptions="VaryByDataType"
                                    HeaderText="订单状态" UniqueName="StrStatus" HeaderStyle-Width="8%" HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <%#Eval("StrStatus")%>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="发票合计<br/>金额(元)" UniqueName="InvoiceSumPay"
                                    HeaderStyle-Width="7%" HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:HiddenField ID="hdnInvoice" runat="server" Value='<%# Eval("InvoiceGUID") %>' />
                                        <a style="cursor: pointer;" onclick='<%# GetInvoiceUrl(Eval("InvoiceGUID"),"1") %>'>
                                            <%#Eval("InvoiceSumPay") %></a>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" Width="7%"></HeaderStyle>
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true">
                            <Selecting AllowRowSelect="True"></Selecting>
                        </ClientSettings>
                        <PagerStyle AlwaysVisible="True" />
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>
                </div>
                <div class="hx_bg">
                </div>
                <div class="liucheng">
                    <div class="xian">
                        <div class="about_title">
                            数字证书产品订单支付流程说明</div>
                    </div>
                    <div style="padding-left: 40px;">
                        <div class="img_nr">
                            <div class="img_h" style="margin-top: 40px;">
                                添加订单</div>
                            <div class="img_border">
                                点击<span class="red">【添加订单】</span>按钮选择所需购买的数字证书产品。</div>
                            <div>
                                <img src="../Images/img_f_CA.jpg" width="117" height="5" /></div>
                        </div>
                        <!--#添加订单结束-->
                        <div class="arrow">
                        </div>
                        <div class="img_nr">
                            <div class="img_h" style="margin-top: 40px;">
                                提交订单</div>
                            <div class="img_border">
                                选择需支付的订单点击<span class="red">【提交订单】</span>按钮支付订单。</div>
                            <div>
                                <img src="../Images/img_f_CA.jpg" width="117" height="5" /></div>
                        </div>
                        <div class="arrow">
                        </div>
                        <div class="img_l">
                        </div>
                        <div class="img_nr">
                            <div class="img_h">
                                线上支付</div>
                            <div class="img_border">
                                通过本网站跳转至银联支付订单。</div>
                            <div>
                                <img src="../Images/img_f_CA.jpg" width="117" height="5" /></div>
                            <div class="img_h" style="margin-top: 5px;">
                                线下支付</div>
                            <div class="img_border">
                                请确认汇款之后，点击<span class="red">【线下汇款确认申请】</span>按钮进行线下支付确认申请。<br />
                                <span class="red">个人汇款时，请在汇款单备注公司全名、以防款项不匹配，影响业务办理。</span><br />
                                <a style="cursor: pointer;" onclick="ShowMoneyForm('CASendMoney.aspx');">银行汇款方式</a></div>
                            <div>
                                <img src="../Images/img_f_CA.jpg" width="117" height="5" /></div>
                        </div>
                        <div class="img_r">
                        </div>
                        <div class="arrow">
                        </div>
                        <div class="img_nr">
                            <div class="img_h" style="margin-top: 40px;">
                                支付完成</div>
                            <div class="img_border">
                                数字证书订单已被受理，等待财务确认。</div>
                            <div>
                                <img src="../Images/img_f_CA.jpg" width="117" height="5" /></div>
                        </div>
                        <!--#添加订单结束-->
                        <div class="arrow after1">
                        </div>
                        <div class="img_nr after1">
                            <div class="img_h" style="margin-top: 40px;">
                                后续手续</div>
                            <div class="img_border">
                                选择相应订单，在订单详细页面中下载数字证书申请表，按要求准备材料并邮寄到数字证书受理单位。</div>
                            <div>
                                <img src="../Images/img_f_CA.jpg" width="117" height="5" /></div>
                        </div>
                        <div class="arrow after2" style="display: none;">
                        </div>
                        <div class="img_nr after2" style="display: none;">
                            <div class="img_h" style="margin-top: 40px;">
                                后续手续</div>
                            <div class="img_border">
                                插入数字证书设备，选择相应订单，在订单详细页面中点击<span class="red">【更新】</span>更新数字证书。</div>
                            <div>
                                <img src="../Images/img_f_CA.jpg" width="117" height="5" /></div>
                        </div>
                        <div class="arrow after3" style="display: none;">
                        </div>
                        <div class="img_nr after3" style="display: none;">
                            <div class="img_h" style="margin-top: 40px;">
                                后续手续</div>
                            <div class="img_border">
                                选择相应订单，在订单详细页面中点击<span class="red">【吊销函】</span>、<span class="red">【数字证书申请表】</span>按要求准备材料并邮寄到数字证书受理单位</div>
                            <div>
                                <img src="../Images/img_f_CA.jpg" width="117" height="5" /></div>
                        </div>
                        <div class="arrow after4" style="display: none;">
                        </div>
                        <div class="img_nr after4" style="display: none;">
                            <div class="img_h" style="margin-top: 40px;">
                                后续手续</div>
                            <div class="img_border">
                                选择相应订单，在订单详细页面中点击<span class="red">【升级】</span>将Key邮寄到数字证书受理单位进行升级</div>
                            <div>
                                <img src="../Images/img_f_CA.jpg" width="117" height="5" /></div>
                        </div>
                        <!--#添加订单结束-->
                        <div class="arrow_x">
                        </div>
                        <div class="img_nr">
                            <div class="img_h" style="margin-top: 40px;">
                                索要发票</div>
                            <div class="img_border">
                                若您需开具发票，请选择订单后点击<span class="red">【索要发票】</span>按钮进行索要发票。</div>
                            <div>
                                <img src="../Images/img_f_CA.jpg" width="117" height="5" /></div>
                        </div>
                        <!--#添加订单结束-->
                        <div class="clear">
                        </div>
                    </div>
                </div>
                <!--#订单列表结束-->
            </td>
            <td class="right_con">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="con_m tt_left_bottom">
                &nbsp;
            </td>
            <td colspan="2" class="con_m">
                &nbsp;
            </td>
            <td class="tt_right_bottom">
                &nbsp;
            </td>
        </tr>
    </table>
    <div id="UDialog" style="margin: auto; width: 900px;">
        <telerik:RadAjaxLoadingPanel runat="server" ID="gridLoadingPanel">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
            <Windows>
                <telerik:RadWindow ID="UserDialog" runat="server" Title="订单信息" Height="600px" Behaviors="Close"
                    Width="900px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
                    Modal="true" Skin="WebBlue" VisibleStatusbar="False" CssClass="DialogCss">
                </telerik:RadWindow>
                <telerik:RadWindow ID="UserDialog2" runat="server" Title="银行付款方式" Height="300px"
                    Behaviors="Close" Width="550px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
                    Modal="true" Skin="WebBlue" VisibleStatusbar="False">
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
    </div>
    <asp:HiddenField ID="hidCorpName" runat="server" />
    <asp:HiddenField ID="hidGroup" runat="server" ClientIDMode="Static" />
</asp:Content>
